<template>
	<view class="goodUl">
		<block v-for="(item, index) of discountList" :key="index">
			<view class="goods-li" @click="details(item)">
				<view class="image-wrapper">
					<easy-loadimage mode="aspectFill" :scroll-top="scrollTop" :image-src="item.image"></easy-loadimage>
				</view>
				<view class="li_msg">
					<view class="h6">{{item.store_name}}</view>
					<view class="span">{{item.line_price}}</view>
					<view class="zq">
						<view class="t1">劵</view>
						<view class="t2">{{item.amount}} <view class="zero">.{{ item.zero }}</view></view>
					</view>
				</view>
			</view>
		</block>
	</view>
</template>

<script>
	import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'
		
	export default {
		name: 'discount',
		components:{easyLoadimage},
		props:['scrollTop', 'discountList'],
		data() {
			return {
				list: []
			};
		},
		methods:{
			details(e) {
				uni.navigateTo({
					url: `/mall/Ticket/IntegralProduct?id=${e.p_id}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.goodUl {
	display: flex;
	overflow-y: hidden;
	overflow-x: auto;
	list-style: none;
	padding-left: 0;
				
	.goods-li {
		list-style: none;
		display: flex;
		flex-direction: column;
		width: 240rpx;
		justify-content: center;
		align-items: center;
		margin-right: 30rpx;
		
		&:last-of-type {
			margin-right: 0;
		}
					
		.image-wrapper {
			width: 200rpx;
			height: 120rpx;
			margin-bottom: 30rpx;
		}
		.li_msg {
			display: flex;
			flex-direction: column;
			width: 100%;
			
			.h6 {
				font-size: 28rpx;
				margin-bottom: 10rpx;
				overflow : hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			.span {
				color: #ccc;
				font-size: 24rpx;
				margin-bottom: 13rpx;
				position: relative;
				margin-right: auto;
				
				&::before {
					position: absolute;
					content: '';
					width: 100%;
					height: 1rpx;
					background-color: #ccc;
					top: 50%;
					transform: translateY(-50%);
				}
			}
			
			.zq {
				display: flex;
				
				.t1 {
					background-color: #FD7373;
					font-size: 22rpx;
					color: #FFFFFF;
					width: 35rpx;
					height: 35rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					border-radius: 3px;
					margin-right: 10rpx;
				}
				.t2 {
					color: #FD7373;
					font-weight: bold;
					display: flex;
					align-items: baseline;
					
					.zero {
						font-size: 22rpx;
						font-weight: normal;
					}
				}
			}
		}
	}
}
</style>
